The present invention relates to a system for managing a record in a block of a recording medium in which the record in a block is managed using a block header and a record header.
A unit of data transfer between a recording medium, e.g., a magnetic recording device and a main memory is a file block. Conventionally, block header (BH) 11 for holding block management information for managing the entire block, at least one of records 12a (A), 12b (B), . . . , stored in the block, and record headers 13a (RHa), 13b (RHb), . . . , for holding record store information for identifying the record are written in the file block, as shown in FIG. 1A.
In a conventional system for managing a record in a block, header 11 is located at a leading area of the block as shown in FIGS. 1A to 1C, and headers 13a, 13b, . . . , are stored in areas subsequent to header 11 so as to make a pair with corresponding records 12a, 12b, . . . , in accordance with a criterion such as a record number and the like.
In a system for managing a record in a block of this type, in order to search for a record having a variable size in a block, no method is available other than a scan search which scans from the head of the block, thereby searching for a desired record. That is, in this scan search, a record header is searched for in order to obtain a record length which is set in the record header, the next record header position is calculated in accordance with the obtained record length, and this operation is repeated to search for a desired record. Therefore, according to the scan search, a processing time is prolonged especially when a block size is large and a large number of records are stored in the block.
In order to eliminate the above problem, Japanese Patent Application No. 60-67002 by Matsunawa discloses a method, in which records are stored from the head of a block, and headers are stored from the end of the block. However, the method by Matsunawa does not disclose that the records can be managed by a logical record number even if a delete instruction of the record is executed.
In the conventional system, even when record B 12b is deleted as shown in FIG. 1B from the block shown in FIG. 1A, and even during a record squeeze (compression) operation after the record is deleted, header RHb 13b of deleted record B 12b must remain in the block, as shown in FIG. 1C, so as to maintain the logical order. For this reason, in the file where the delete operation is frequently performed, record headers of unnecessary, deleted records must be referred to in order to search for an effective record in the block at that time, and the record process time is further increased. In addition, when store/delete operations of the record are frequently performed, the record header of the deleted record remains, and an empty area in the block is decreased by an amount of the record header of the deleted record. Therefore, it is difficult to effectively utilize the block area.
Therefore, the scan search is conventionally required to search for a record in a block as described above, it is difficult to search for the record at a high speed. In addition, the record header of the deleted record must remain to maintain the logical order of the stored record. Furthermore, it is difficult to effectively utilize the block area because the record header of the deleted record must be maintained in the block.